home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-1297 / AMOSLIST / 000014_amos-request@svcs1.digex.net_Tue Dec 2 19:26:59 1997.msg < prev    next >
Text File  |  1998-06-24  |  3KB  |  79 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail4.access.digex.net (8.8.5/8.8.5) with ESMTP id TAA27317
  3.     for <mcox@access.digex.net>; Tue, 2 Dec 1997 19:26:48 -0500 (EST)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id QAA22172
  6.     for amos-out; Tue, 2 Dec 1997 16:20:30 -0500 (EST)
  7. Received: from mail4.access.digex.net (mail4.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id QAA22169
  9.     for <amos-list@svcs1.digex.net>; Tue, 2 Dec 1997 16:20:29 -0500 (EST)
  10. Received: from mailhost.sosbbs.com (sosbbs.com [204.186.168.100])
  11.     by mail4.access.digex.net (8.8.5/8.8.5) with SMTP id QAA03129
  12.     for <amos-list@access.digex.net>; Tue, 2 Dec 1997 16:20:16 -0500 (EST)
  13. Received: from gbenjam (204.186.168.71) by mailhost.sosbbs.com
  14.  (EMWAC SMTPRS 0.81) with SMTP id <B0000150245@mailhost.sosbbs.com>;
  15.  Tue, 02 Dec 1997 16:19:18 -0500
  16. Message-ID: <B0000150245@mailhost.sosbbs.com>
  17. From: "Garfield Benjamin" <gbenjam@sosbbs.com>
  18. To: "AMOS MAILING LIST" <amos-list@access.digex.net>
  19. Subject: Re: Fast collisions - THE REAL CODE!!!!
  20. Date: Tue, 2 Dec 1997 16:25:29 -0500
  21. X-MSMail-Priority: Normal
  22. X-Priority: 3
  23. X-Mailer: Microsoft Internet Mail 4.70.1155
  24. MIME-Version: 1.0
  25. Content-Type: text/plain; charset=ISO-8859-1
  26. Content-Transfer-Encoding: 7bit
  27. Status: O
  28. X-Status: 
  29.  
  30.  
  31.    Amazing isn't?  How you can write something and then later take a
  32.    look at it and the foolishness is no very obvious...
  33.  
  34.    In my previous reply to the collision-detection I made a rather  
  35.    stupid design, resulting in the collision-detection being MUCH
  36.    slower than it should be, not quite sure what happened there, 
  37.    sorry.  :)
  38.  
  39.    Anyway, the new design is:
  40.  
  41.    For OBJECT1=0 To 10
  42.       If Bob Col(OBJECT1, OBJECT1+1 To 11)
  43.          For OBJECT2=OBJECT1+1 To 11
  44.             If Col(OBJECT2)
  45.                Rem  Objects OBJECT1 and OBJECT2 have collided, so
  46.                Rem  do your collision-processing here...
  47.             End If
  48.          Next OBJECT2      
  49.       End If
  50.    Next OBJECT1
  51.  
  52.    Now, THAT IS AN OPTIMIZED DESIGN!!!!
  53.    
  54.    The advantages over the first one:
  55.   
  56.    1.  The MAIN advantage is that each collision between any two
  57.         objects is only performed once so we only need a total of 66
  58.         Col checks, AND these Col checks are only performed if
  59.         AMOS has detected a collison, so it should be VERY FAST.
  60.    2.  The actual loop-processing is very tiny which means it will be
  61.         quite fast.
  62.    3.  We're no longer utilizing an external Procedure call, which also
  63.         makes this version a bit faster.
  64.  
  65.    Finally, the whole thing is highly stream-lined and is the essence of
  66.    creating an optimized design!!
  67.  
  68.    If this doesn't speed up your game then the problem MUST be
  69.    something other than the collision-detection...
  70.  
  71.    Let me know what the new frame-rate is!!
  72.  
  73.  
  74.       Take  care,   
  75.       GARFIELD
  76.       _________________________
  77.       Current projects...
  78.       SideShooter(AMOS): 85% Complete
  79.       Website(http://www.sosbbs.com/~gbenjam): 20% Complete